package cn.sanxintong.utils.generate;

import java.io.File;
import java.sql.ResultSet;
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang.StringUtils;

import cn.sanxintong.entity.constant.Constant;
import cn.sanxintong.entity.constant.FileConstant;
import cn.sanxintong.utils.freemarker.FreeMarkerTemplateUtils;

/**
 * ServiceImpl 服务实现层工具类
 * @author hxy
 * @version 1.0.0
 */
public class ServiceImplUtil {
	 public static void generateServiceImplFile(ResultSet resultSet) throws Exception{
	        final String path = Constant.DISK_PATH + StringUtils.substring(Constant.CHANGE_TABLE_NAME, 3) + FileConstant.SERVICE_IMPL_PREFIX;
	        final String templateName = "ServiceImpl.ftl";
	        File mapperFile = new File(path);
	        Map<String,Object> dataMap = new HashMap<>();
	        FreeMarkerTemplateUtils.generateFileByTemplate(templateName,mapperFile,dataMap);
	        System.out.println("service实现层生成了");
	    }
}
